/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ep.persistence.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Spyros
 */
@Entity
@Table(name = "t005_t007", catalog = "epresc", schema = "")
@NamedQueries({
    @NamedQuery(name = "T005T007.findAll", query = "SELECT t FROM T005T007 t"),
    @NamedQuery(name = "T005T007.findById", query = "SELECT t FROM T005T007 t WHERE t.id = :id"),
    @NamedQuery(name = "T005T007.findByDateInsert", query = "SELECT t FROM T005T007 t WHERE t.dateInsert = :dateInsert")})
public class T005T007 implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "date_insert")
    @Temporal(TemporalType.DATE)
    private Date dateInsert;
    @JoinColumn(name = "t007_illness_id", referencedColumnName = "id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private T007Illness t007Illness;
    @JoinColumn(name = "t005_patient_id", referencedColumnName = "id")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private T005Patient t005Patient;

    public T005T007() {
    }

    public T005T007(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDateInsert() {
        return dateInsert;
    }

    public void setDateInsert(Date dateInsert) {
        this.dateInsert = dateInsert;
    }

    public T007Illness getT007Illness() {
        return t007Illness;
    }

    public void setT007Illness(T007Illness t007Illness) {
        this.t007Illness = t007Illness;
    }

    public T005Patient getT005Patient() {
        return t005Patient;
    }

    public void setT005Patient(T005Patient t005Patient) {
        this.t005Patient = t005Patient;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof T005T007)) {
            return false;
        }
        T005T007 other = (T005T007) object;
        if ((this.t007Illness == null && other.t007Illness != null) || (this.t007Illness != null && !this.t007Illness.equals(other.t007Illness))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ep.persistence.entities.T005T007[id=" + id + "]";
    }

}
